<?php
/**
 * create
 * select
 * drop
 */
//连接数据库
$con = mysqli_connect("localhost","root","123");
if(!$con){
    echo "connect failure, " . mysqli_error();
}else{
    echo "connect success.<br />";
    //新建数据库
    if(mysqli_query($con,"CREATE DATABASE my_db1")){
        echo "create success <br />";
    }else{
        echo "Create failure:" . mysqli_error() . "<br />";
    }
    //选择数据库
    if(mysqli_select_db($con,"my_db1")){
        echo "select success<br />";
    }else{
        echo "select failure<br />";
    }

    //删除数据库
    if(mysqli_query($con,"drop database my_db1")){
        echo "drop success <br />";
    }else{
        echo "drop failure <br />";
    }
    mysqli_close($con);
}


